//
//  CataHeaderCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/8/30.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "CataHeaderCell.h"

@implementation CataHeaderCell

-(void)layoutSubviews{
    [self createSubviews];
}

/**
 创建子视图布局
 */
-(void)createSubviews{
    UIImageView *headerImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:headerImageView];
    [headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(self.contentView);
        make.height.mas_equalTo(scaleTopAndBottom(200));
    }];
    UILabel *titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(headerImageView.mas_bottom).offset(scaleTopAndBottom(5));
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(5));
        make.size.mas_equalTo(CGSizeMake(WIDTH - scaleLeftAndRight(5), scaleTopAndBottom(20)));
    }];
    UILabel *englishtitleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:englishtitleLabel];
    [englishtitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLabel.mas_bottom).offset(scaleTopAndBottom(0));
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(5));
        make.size.mas_equalTo(CGSizeMake(WIDTH - scaleLeftAndRight(5), scaleTopAndBottom(20)));
    }];
    UIView *lineViewe = [[UIView alloc] init];
    [self.contentView addSubview:lineViewe];
    [lineViewe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(englishtitleLabel.mas_bottom).offset(scaleTopAndBottom(3));
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(5));
        make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(30), scaleTopAndBottom(2)));
    }];
    UILabel *descripLabel = [[UILabel alloc] init];
    [self.contentView addSubview:descripLabel];
    [descripLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lineViewe.mas_bottom).offset(scaleTopAndBottom(10));
        make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(5));
        make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-5));
        make.height.mas_equalTo(scaleTopAndBottom(180));
    }];
    headerImageView.backgroundColor = [UIColor cyanColor];
    titleLabel.text = @"折纸简介";
    englishtitleLabel.text = @"HELLO Everyone";
    lineViewe.backgroundColor = [ UIColor yellowColor];
    descripLabel.backgroundColor = [UIColor purpleColor];
}
@end
